package com.sunshine.user.conver;

import com.sunshine.user.dto.UserRegisterDTO;
import com.sunshine.user.entity.Users;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import org.springframework.stereotype.Component;

/**
 * 用户DTO和实体类之间的转换器
 */
@Mapper(componentModel = "spring")
@Component
public interface UserConverter {
    
    /**
     * 将UserRegisterDTO转换为Users实体
     * @param userRegisterDTO 用户注册DTO
     * @return Users实体
     */
    Users convertToUser(UserRegisterDTO userRegisterDTO);
    
    /**
     * 将Users实体转换为UserRegisterDTO
     * @param users 用户实体
     * @return UserRegisterDTO
     */
    UserRegisterDTO convertToDTO(Users users);
}